<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
            padding-left: 30px;
        }
        .step{
            display: flex;
            flex-flow: row nowrap;
            width: 600px;
            /* background-color: #dedede; */
            /* justify-content: space-between; */
        }
        .step .item:not(:last-child){
            /* 
                弹性盒子元素分组
                弹性盒子子元素在剩余宽度中进行分组
            */
            flex-grow: 1;
            /* border: 1px solid black; */
            position: relative;
            margin-right: 6px;
        }
        .step .item:not(:last-child)::after{
            content: "";
            position: absolute;
            left: 0px;
            top: 50%;
            width: 100%;
            height: 0px;
            padding: 0px;
            margin: 0px;
            border-top: 2px solid #999;
            transform: translate(0px,-50%);
            z-index: -1;
        }
        .item span{
            background-color: white;
            padding:0px 6px;
        }
        .item i{
            font-style: normal;
            display: inline-block;
            width: 20px;
            height: 20px;
            background-color: #dedede;
            border-radius: 50%;
            text-align: center;
            font-size: 14px;
            line-height: 20px;
        }
        .item.active{
            color: green;
        }
        .item.active i{
            background-color: green;
            color: white;
        }
        .step .item.active::after{
            border-color: green;
        }
    </style>
</head>
<body>
    <div id="app">
        
        <div class="step">
            <div class="item" :class="{ active:step>=1 }">
                <i>1</i>
                <span>账号密码</span>
            </div>
            <div class="item" :class="{ active:step>=2 }">
                <i>2</i>
                <span>手机绑定</span>
            </div>
            <div class="item" :class="{ active:step>=3 }">
                <i>3</i>
                <span>邮箱绑定</span>
            </div>
            <div class="item" :class="{ active:step>=4 }">
                <i>4</i>
                <span>注册完成</span>
            </div>
        </div>

        <input type="button" value="上一步" @click=" step-- ">
        <input type="button" value="下一步" @click=" step++ ">

    </div>
    <script type="module">
        // 加载 Vue3 的ESM 模块文件
        import { createApp } from "../assets/vue3/vue.esm-browser.js"
        createApp({
            data(){
                return {
                    step:0
                }
            }
        }).mount("#app")
    </script>
</body>
</html>